<style scoped lang="scss">
.banl_card {
  padding: 0.36rem;
  .card {
    height: 1.68rem;
    padding: 0.2rem 0.15rem 0.15rem;
    box-sizing: border-box;
    .tit {
      display: flex;
      justify-content: space-between;
      align-items: center;
      .del {
        width: 0.52rem;
        height: 0.24rem;
        border-radius: 0.04rem;
        border: 1px solid #fff;
      }
    }
  }
  .li18 {
    line-height: 0.2rem;
  }
  footer {
    margin-top: 0.7rem;
    height: 0.45rem;
  }
}
</style>

<template>
  <div class="banl_card full bgfff">
    <div class="card bor-r10 cfff bgred flex-row">
      <div class="tit font-12">
        {{cardInfo.cardType}}
        <div class="del box-center" @click="delCard">删除</div>
      </div>
      <div class="box1 box-center font-16">{{cardInfo.cardNumber}}</div>
      <div class="font-10 cfff">限额：单笔50000元，日累计50000元</div>
    </div>
    <div class="padding-tb20 li18">温馨提示：只能绑定一张储蓄卡，绑定好只能使用该卡进行提现</div>
    <footer class="bor-r5 bgred cfff box-center" @click="toRouter('add_card/'+cardInfo.bankcardCode)">
      更换银行卡
    </footer>
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
      cardInfo: {}
    };
  },
  mounted() {
    let that = this;
    this.$nextTick(()=>{
      that.getCard();
    })
  },
  methods: {
    //获取用户银行卡信息
    getCard() {
      let that = this;
      this.http.get("userbankcard/info").then(res => {
        that.cardInfo = res.data;
        that.setCache('cardInfo',that.cardInfo);
      });
    },
    // 删除银行卡信息
    delCard(){
      let that = this;
      this.http.post("userbankcard/delete").then(res => {
        that.layer('删除成功','m');
      });
    }
  }
};
</script>

